/*
 * CPFCNPJValidatorTag.java
 *
 * Created on 13 de Maio de 2007, 19:25
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package net.sf.jOpinionPoll.tag.validator;

import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.webapp.ValidatorELTag;
import javax.servlet.jsp.JspException;

/**
 *
 * @author erico
 */
@Deprecated
public class SizeValidatorTag extends ValidatorELTag {
	private static final long serialVersionUID = 1L;
	
    public static final String VALIDATOR_ID = "SizeValidator";
    private int m_Min;
    private int m_Max;
    
    /** Creates a new instance of SizeValidatorTag */
    public SizeValidatorTag() {
        setId(VALIDATOR_ID);
    }
    
    public Validator createValidator() throws JspException {
    	FacesContext facesContext = FacesContext.getCurrentInstance();
        SizeValidator validator;
        
        validator = (SizeValidator)facesContext.getApplication().createValidator(getId());
        
        validator.setMin(getMin());
        validator.setMax(getMax());
        
        return validator;
    }
    
    public int getMin() {
        return m_Min;
    }
    
    public void setMin(int min) {
        this.m_Min = min;
    }
    
    public int getMax() {
        return m_Max;
    }
    
    public void setMax(int max) {
        this.m_Max = max;
    }
    
}
